<template>
    <div>
        退出登录
    </div>
</template>
<script>
export default {
    methods: {
        logout () {
            this.$api.admin_auth_logout().then();
            sessionStorage.clear();
            this.$store.commit('logout', this);
            this.$store.commit('clearOpenedSubmenu');
            this.$router.push({
                name: 'login'
            });
        },
    },
    created () {
        this.logout();
    }
};
</script>
